<?php
if (isset($errors[$field])) {

    foreach ($errors[$field] as $error) {
        ?>
        <small class="help-block"><?= $error ?></small>
    <?php
    }
}?>